import req from '@/http/http'
import config from '@/config/index'

// zhpq接口
const ZHPQ_SERVER = config.serverUrl()

export const getServer = _ => {
  return ZHPQ_SERVER
}
// 委托人
export const createClient = data => {
  let path = ZHPQ_SERVER + '/lawClient/'
  return req.post(path, data)
}
// 查询列表
export const findClient = data => {
  let path = ZHPQ_SERVER + '/lawClient'
  return req.get(path, data)
}
// 修改权限
export const updateClient = data => {
  let path = ZHPQ_SERVER + '/lawClient/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteClient = data => {
  let path = ZHPQ_SERVER + '/lawClient/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getClient = data => {
  let path = ZHPQ_SERVER + '/lawClient/' + data.id
  return req.get(path)
}

// 被告人
export const createDefendant = data => {
  let path = ZHPQ_SERVER + '/caseDefendantPerson/'
  return req.post(path, data)
}
// 查询列表
export const findDefendant = data => {
  let path = ZHPQ_SERVER + '/caseDefendantPerson'
  return req.get(path, data)
}
// 修改权限
export const updateDefendant = data => {
  let path = ZHPQ_SERVER + '/caseDefendantPerson/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteDefendant = data => {
  let path = ZHPQ_SERVER + '/caseDefendantPerson/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getDefendant = data => {
  let path = ZHPQ_SERVER + '/caseDefendantPerson/' + data.id
  return req.get(path)
}

// 被告单位
export const createDefendantUnit = data => {
  let path = ZHPQ_SERVER + '/caseDefendantUnit/'
  return req.post(path, data)
}
// 查询列表
export const findDefendantUnit = data => {
  let path = ZHPQ_SERVER + '/caseDefendantUnit'
  return req.get(path, data)
}
// 修改权限
export const updateDefendantUnit = data => {
  let path = ZHPQ_SERVER + '/caseDefendantUnit/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteDefendantUnit = data => {
  let path = ZHPQ_SERVER + '/caseDefendantUnit/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getDefendantUnit = data => {
  let path = ZHPQ_SERVER + '/caseDefendantUnit/' + data.id
  return req.get(path)
}

// 原告人
export const createPlaintiff = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffPerson/'
  return req.post(path, data)
}
// 查询列表
export const findPlaintiff = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffPerson'
  return req.get(path, data)
}
// 修改权限
export const updatePlaintiff = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffPerson/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deletePlaintiff = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffPerson/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getPlaintiff = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffPerson/' + data.id
  return req.get(path)
}

// 原告单位
export const createPlaintiffUnit = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffUnit/'
  return req.post(path, data)
}
// 查询列表
export const findPlaintiffUnit = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffUnit'
  return req.get(path, data)
}
// 修改权限
export const updatePlaintiffUnit = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffUnit/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deletePlaintiffUnit = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffUnit/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getPlaintiffUnit = data => {
  let path = ZHPQ_SERVER + '/casePlaintiffUnit/' + data.id
  return req.get(path)
}

// 法院
export const createLawCourt = data => {
  let path = ZHPQ_SERVER + '/lawCourt/'
  return req.post(path, data)
}
// 查询列表
export const findLawCourt = data => {
  let path = ZHPQ_SERVER + '/lawCourt'
  return req.get(path, data)
}
// 修改权限
export const updateLawCourt = data => {
  let path = ZHPQ_SERVER + '/lawCourt/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteLawCourt = data => {
  let path = ZHPQ_SERVER + '/lawCourt/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getLawCourt = data => {
  let path = ZHPQ_SERVER + '/lawCourt/' + data.id
  return req.get(path)
}

// 查询列表
export const findAllLawCourt = data => {
  let path = ZHPQ_SERVER + '/lawCourt/list'
  return req.get(path, data)
}

// 法官
export const createLawJudge = data => {
  let path = ZHPQ_SERVER + '/lawJudge/'
  return req.post(path, data)
}
// 查询列表
export const findLawJudge = data => {
  let path = ZHPQ_SERVER + '/lawJudge'
  return req.get(path, data)
}
// 修改权限
export const updateLawJudge = data => {
  let path = ZHPQ_SERVER + '/lawJudge/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteLawJudge = data => {
  let path = ZHPQ_SERVER + '/lawJudge/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getLawJudge = data => {
  let path = ZHPQ_SERVER + '/lawJudge/' + data.id
  return req.get(path)
}

// 企业管理
export const createCompanyManagement = data => {
  let path = ZHPQ_SERVER + '/companyManagement/'
  return req.post(path, data)
}
// 查询列表
export const findCompanyManagement = data => {
  let path = ZHPQ_SERVER + '/companyManagement'
  return req.get(path, data)
}
// 修改权限
export const updateCompanyManagement = data => {
  let path = ZHPQ_SERVER + '/companyManagement/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteCompanyManagement = data => {
  let path = ZHPQ_SERVER + '/companyManagement/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getCompanyManagement = data => {
  let path = ZHPQ_SERVER + '/companyManagement/' + data.id
  return req.get(path)
}

export const findAllCompanyManagement = data => {
  let path = ZHPQ_SERVER + '/companyManagement/list'
  return req.get(path, data)
}

// 服务记录
export const createServiceLog = data => {
  let path = ZHPQ_SERVER + '/serviceLog/'
  return req.post(path, data)
}
// 查询列表
export const findServiceLog = data => {
  let path = ZHPQ_SERVER + '/serviceLog'
  return req.get(path, data)
}
// 修改权限
export const updateServiceLog = data => {
  let path = ZHPQ_SERVER + '/serviceLog/' + data.id
  return req.put(path, data)
}
// 删除权限
export const deleteServiceLog = data => {
  let path = ZHPQ_SERVER + '/serviceLog/' + data.id
  return req.delete(path)
}
// 获取当条详细信息
export const getServiceLog = data => {
  let path = ZHPQ_SERVER + '/serviceLog/' + data.id
  return req.get(path)
}
